package com.example.shiro.util;

import org.apache.shiro.crypto.hash.Md5Hash;

/**
 * @author lijilong
 * @version 1.0
 * @Description:
 * @CreateDate 2018/8/8 20:27
 */
public class MD5Util {

    public static String encrypt(String password){
        Md5Hash md5Hash = new Md5Hash(password);
        return md5Hash.toHex();
    }

    public static String encryptSalt(String password, String salt){
        Md5Hash md5Hash = new Md5Hash(password, salt);
        return md5Hash.toHex();
    }

    public static void main(String[] args) {
        System.out.println(encryptSalt("123456", "kitty"));
    }

}
